package com.xxbb.chapter_7.dome4;


import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Properties;

import com.xxbb.util.tool.Tool;


public class Program {

	/**
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {
		// 设置Properties文件
		Properties properties = new Properties();
		properties.setProperty("name", "张三");
		String fileName = "app.properties";
		FileOutputStream  outputStream= new FileOutputStream(fileName);
		properties.store(outputStream, "app");
		outputStream.close();
		//读取
		fileName="app.Properties";
		FileInputStream inputStream=new FileInputStream(fileName);
		properties.load(inputStream);
		inputStream.close();
		Tool.println(properties.getProperty("name"));
	}

}
